STK.register('app.common.getElement',function($){
	return function(el, type, tagName,attributeName,attributeValue){
		if(!el) return;
        if (tagName) {
            tagName = tagName.toUpperCase();
        }
        var node = el[type];
        while (node) {
            if (node.nodeType == 1 && (tagName ? node.nodeName == tagName : true) && (attributeName ? node.getAttribute(attributeName) == attributeValue : true)) {
                break;
            }
            node = node[type];
        }
        return node;
	};
});